import { joinArr, filterArr, readJson, writeJson } from '../common/utils.js'

const setup = () => {
  const json = readJson('details')
  const data = JSON.parse(json).map((k: any) => {
    return {
      jId: k.jId,
      location: k.location,
      longitude: k.longitude,
      latitude: k.latitude,
      skills: joinArr(k.skills),
      desc: filterArr(k.description[0])
    }
  })
  const _json = JSON.stringify(data, null, 2)
  writeJson('details_v2', _json)  
}

export default setup